﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reviewer.Entities.Services;
using Reviewer.Entities;
using Reviewer.Data;

namespace Reviewer.Business.Services
{
    internal class GameScreenshotService : BaseService, IGameScreenshotService
    {
        internal GameScreenshotService() : base() { }

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }

        public ICollection<GameScreenshotSearchResult> Search(int topCount)
        {
            return new GameScreenshotRepository().Search(topCount);
        }

        public ICollection<GameScreenshotSearchResult> Search(String gameTitle, Int32? gameFormat, Int32? gameGenre, Int32? maxResults)
        {
            return new GameScreenshotRepository().Search(gameTitle, gameFormat, gameGenre, maxResults);
        }

        public GameScreenshot Find(int id)
        {
            return new GameScreenshotRepository().SelectBy(id);
        }

        public ICollection<GameScreenshot> Find(Guid gameId)
        {
            return new GameScreenshotRepository().SelectByAlternateKey(gameId);
        }

        public ICollection<GameScreenshot> FindNewsRelated(int newsId)
        {
            return new GameScreenshotRepository().FindByNewsRelation(newsId);
        }
    }
}
